/*
 * Copyright (c) gitee.com/jiandong001.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

import { YogaUnit } from './YogaUnit';
import { YogaValue } from './YogaValue';
/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

export class YogaConstants {

  public static readonly UNDEFINED: number = undefined //Float.NaN;

  public static isUndefined(value: number | YogaValue): boolean {
    if (typeof value === 'number') {
      return value === this.UNDEFINED
    }

    let temp = value as YogaValue
    return temp.unit === YogaUnit.UNDEFINED;

  }

//  public static isUndefined(value: YogaValue): boolean {
//    return value.unit === YogaUnit.UNDEFINED;
//  }

  public static getUndefined(): number {
    return YogaConstants.UNDEFINED;
  }
}
